{% extends 'base_notifications.html' %}
{% load static %}

{% block nf_list %}
  <div>
    <h2 class="page-header">{{ notification.title }}</h2>

    <div class="row" style="padding-top: 5px;">
      <div class="col-md-9">
        <div class="text-left">
          <a href="{% url 'grade' notification.grade %}" class="btn btn-sm btn-default">{{ notification.grade }}</a>
        </div>
      </div>
      <div class="col-md-3">
        <div class="text-right">
          <p class="text-muted"> {{ notification.created_time|date:"Y-m-j H:i:s" }} </p>
        </div>
      </div>
    </div>

    {{ notification.content|safe|linebreaks }}

    <br>

    {% if notification.file %}
      <img src="{{ notification.file.url }}"/>
    {% endif %}
    <div class="row"><br><br></div>

    <div class="row">
      <div class="pull-right">
        <div class="btn-group">
          <a href="{% url 'view' %}" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-chevron-left"></span> Back</a>
          {% if user %}
            <a href="{% url 'edit' notification.pk %}" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-edit"></span> Edit</a>
          {% endif %}
        </div>
      </div>
    </div><br><br>

    <div class="row">
      {% if last %}
        <a class="pull-left" href="{% url 'detail' last.pk %}"><span class="glyphicon glyphicon-chevron-left"></span> {{ last.title }}</a>
      {% else %}
        <p class="text-muted pull-left"><span class="glyphicon glyphicon-chevron-left"></span> 已是第一篇</p>
      {% endif %}
      {% if next %}
        <a class="pull-right" href="{% url "detail" next.pk %}">{{ next.title }} <span class="glyphicon glyphicon-chevron-right"></span></a>
      {% else %}
        <p class="text-muted pull-right">已是最后一篇 <span class="glyphicon glyphicon-chevron-right"></span></p>
      {% endif %}
    </div>
  </div><br><br>
{% endblock %}